home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / fontutil.6 / fontutil / fontutils-0.6 / include / dirio.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-07-22  |  1.6 KB  |  50 lines

  1. /* dirio.h: checked directory operations.
  2.  
  3. Copyright (C) 1992 Free Software Foundation, Inc.
  4.  
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2, or (at your option)
  8. any later version.
  9.  
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. GNU General Public License for more details.
  14.  
  15. You should have received a copy of the GNU General Public License
  16. along with this program; if not, write to the Free Software
  17. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  18.  
  19. #ifndef DIRIO_H
  20. #define DIRIO_H
  21.  
  22. #if DIRENT || _POSIX_VERSION
  23. #include <dirent.h>
  24. #define NLENGTH(dirent) strlen ((dirent)->d_name)
  25. #else /* not (DIRENT or _POSIX_VERSION) */
  26. #define dirent direct
  27. #define NLENGTH(dirent) ((dirent)->d_namlen)
  28. #ifdef USG
  29. #ifdef SYSNDIR
  30. #include <sys/ndir.h>
  31. #else /* not SYSNDIR */
  32. #include <ndir.h>
  33. #endif /* SYSNDIR */
  34. #else /* not USG */
  35. #include <sys/dir.h>
  36. #endif /* USG */
  37. #endif /* DIRENT or _POSIX_VERSION */
  38.  
  39. /* Like opendir, closedir, and chdir, but abort if DIRNAME can't be opened.  */
  40. extern DIR *xopendir P1H(string dirname);
  41. extern void xclosedir P1H(DIR *);
  42.  
  43. /* Returns true if FN is a directory (or a symlink to a directory).  */
  44. extern boolean dir_p P1H(string fn);
  45.  
  46. /* Returns true if FN is directory with no subdirectories.  */
  47. extern boolean leaf_dir_p P1H(string fn);
  48.  
  49. #endif /* not DIRIO_H */
  50.